import time

from Page import Page
from Pozk0903.Page2 import Page2
from selenium.webdriver.common.by import By
from selenium import webdriver
import unittest
import pytest,logging

@pytest.fixture(scope='class')
def driver()->None:
    driver=webdriver.Firefox()
    driver.maximize_window()
    yield driver
    time.sleep(3)
    driver.quit()

def test_jiuxian_01(driver):
    logging.info('----------begin-------------')
    po = Page(driver)

    # po.jiuxian_luoji_gwc()

    po.open_url('https://www.jiuxian.com/')
    time.sleep(5)
    po.login()
    po.username()
    po.password()
    time.sleep(15)
    po.anniu()
    po.driver.implicitly_wait(10)
    po.srk()
    po.ss()
    time.sleep(4)
    po.sp()
    po.window()
    po.gwc()
    logging.info('----------end-------------')

# def test_jiuxian_02(driver):
#     po = Page2(driver)
#     po.jiuxian_luoji_sc()



# class Case(unittest.TestCase):
#
#     def setUp(self) -> None:
#         self.driver=webdriver.Firefox()
#         self.driver.maximize_window()
#
#     def tearDown(self) -> None:
#         time.sleep(3)
#         self.driver.quit()
#
#     def test_case_01(self):
#         po=Page('')
#         po.jiuxian_luoji_gwc()
#
#     def test_case_02(self):
#         po=Page2('')
#         po.jiuxian_luoji_sc()